﻿@model Model.LogOnModel

@{
    ViewBag.Title = "Log On";
}
<section class="content">
<h2>Log On</h2>
<p>
    Please enter your user name and password. @Html.ActionLink("Register", "Register") if you don't have an account.
</p>

@Html.ValidationSummary(true, "Login was unsuccessful. Please correct the errors and try again.")

<div class="containerLogon">
    @using (Html.BeginForm()) {

        <fieldset>
            <div class="rowLogon">
                <div class="logonLabel">
                    @Html.LabelFor(m => m.UserName)
                </div>
                <div>
                    @Html.TextBoxFor(m => m.UserName, new { @class = "logonInput", required="required",placeHolder="User Name"})
                </div>
                @Html.ValidationMessageFor(m => m.UserName)
                <div class="clearFloat" />
            </div>
            <div class="rowLogon">
                <div class="logonLabel">
                    @Html.LabelFor(m => m.Password)
                </div>
                <div>
                    @Html.PasswordFor(m => m.Password, new { @class = "logonInput", required = "required", placeholder = "Password" })
                </div>
                 @Html.ValidationMessageFor(m => m.Password)
                <div class="clearFloat" />
                <div class="rowLogon">
                    @Html.CheckBoxFor(m => m.RememberMe, new { @class = "centered" })
                    @Html.LabelFor(m => m.RememberMe)
                </div>
            </div>
                <input type="submit" class="buttonLogon" value="Log On" />


                       <div id="fb-root"></div>
                        <script>
                            //initializing API
                            window.fbAsyncInit = function () {
                                FB.init({
                                    appId: '420367354715140', status: true, cookie: true,
                                    xfbml: true
                                });
                            };
                            (function () {
                                var e = document.createElement('script'); e.async = true;
                                e.src = document.location.protocol +
                                  '//connect.facebook.net/en_US/all.js';
                                document.getElementById('fb-root').appendChild(e);
                            }());
                        </script>

                        <!-- custom login button -->
                        <a href="#" onclick="fblogin();return false;">Login Fb<img src="images/my_login.png"></a>

                        <script>
                            //your fb login function
                            function fblogin() {
                                FB.login(function (response) {
                                    //...
                                    console.log(response);
                                }, { scope: 'read_stream,publish_stream,offline_access' });
                            }
                        </script>

        </fieldset>
    }
</div>

</section>

@section scripts
{
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
}